﻿using System;
using System.ComponentModel.DataAnnotations;
using Viettel.VOFFICE.DAO.Models;

namespace Viettel.VOFFICE.Web.Models
{
    public class NodeRelationModel : BaseModel
    {
        public NodeRelationModel() { }

        public NodeRelationModel(NodeRelation nodeRelation)
        {
            FromNodeId = nodeRelation.FromNodeId;
            ToNodeId = nodeRelation.ToNodeId;
            Name = nodeRelation.Name;
            FlowId = nodeRelation.FlowId;
            CreatedAt = nodeRelation.CreatedAt;
            UpdatedAt = nodeRelation.UpdatedAt;
        }
        [Required]
        [Range(1, int.MaxValue)]
        public int FromNodeId { get; set; }

        [Required]
        [Range(1, int.MaxValue)]
        public int ToNodeId { get; set; }

        public string Name { get; set; }
        
        [Required]
        [Range(1, int.MaxValue)]
        public int FlowId { get; set; }
        
        public DateTime CreatedAt { get; set; }
        public DateTime UpdatedAt { get; set; }
        public Guid? CreatorId { get; set; }
    }
}